SOFTWARE-GRADE ANALYTICS / PIPELINE AUTOMATION
XSMB Analytics collapses the manual cycle of collecting Northern Vietnam lottery results, computing frequency/recency statistics, and publishing charts into a single typed CLI — run daily by CI and deployed to GitHub Pages as an interactive Plotly dashboard.
01 / CONTEXT & PROBLEM
Most personal analytics projects are a notebook that worked once. This project's real objective was engineering discipline on a small, honest dataset: strict typing, validated inputs, incremental state, tests that gate every change, and automation that keeps the output current without a human in the loop.
02 / ARCHITECTURE
Daily XSMB results
collected on schedule
→
pydantic validation
typed models · malformed draws rejected
→
Incremental CSV history
append-only · dedup on draw date
→
Analytics engine
frequency · recency · pattern statistics
→
Plotly dashboard
auto-published to GitHub Pages daily
Typer CLI wraps every stage · GitHub Actions runs the full cycle daily · strict mypy + 30+ tests gate merges
03 / KEY DECISIONS & RESULTS
Strict mypy + pydantic everywhere
Every record and config passes typed validation; an upstream format change fails loudly at the boundary instead of corrupting history silently.
Modular stages behind one Typer CLI
Collect, validate, analyze and publish are separate testable modules; the CLI composes them so CI and a human run exactly the same path.
Statistics, honestly framed
Frequency and recency views describe historical draws — the dashboard never claims predictive power over a random process. Framing outputs truthfully is part of the job.
04 / WHAT I'D DO DIFFERENTLY
Incremental CSV is transparent and diff-able, but as history grows I'd move to DuckDB or SQLite for typed queries and faster aggregates — keeping the CSV export as the human-readable artifact rather than the system of record.